package com.six.goods.controller;

import com.six.core.util.UploadUtil;
import com.six.core.vo.Result;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.multipart.MultipartFile;

/**
 * @Author: whj
 * @Version 1.0
 * @Date: 2023/3/10  17:00
 */
@RestController
@RequestMapping("/goods/upload")
public class UploadUtilController {

    @PostMapping("/upload")

    public Result upload(MultipartFile file) throws Exception {
        String path = UploadUtil.ossUpload(file);
        return new Result(200, "上传成功", path);
    }
}
